package com.bdqn.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class HelloController {

    @GetMapping("/hello1")
    public String showHelloForm() {
        return "hello1";
    }
    @GetMapping("/add")
    public String showHelloForm1() {
        return "add";
    }
    @PostMapping("/show")
    public String showMessage(@RequestParam("message") String message, Model model) {
        model.addAttribute("enteredMessage", message);
        return "show";
    }
    @PostMapping("/show1")
    public String showMessage1(@RequestParam("message") String message, Model model) {
        model.addAttribute("enteredMessage", message);
        return "show1";
    }
}
